//
//  ISPTabBar.m
//  isou_pad
//
//  Created by wangneihan on 16/4/25.
//  Copyright © 2016年 isou. All rights reserved.
//

#import "ISPTabBar.h"

@implementation ISPTabBar

-(void)setBtnItems:(NSArray *)btnItems
{
    _btnItems = btnItems;
    for (UIButton *item in _btnItems) {
        [self addSubview:item];
    }
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat iconH = self.bounds.size.height/(4);
    CGFloat iconW = self.bounds.size.width;
    
    CGFloat iconX = 0;
    CGFloat iconY = 0;
    int x=0;
    for (UIView *subView in self.subviews) {
        if([subView isKindOfClass:NSClassFromString(@"UIButton")])
        {
            iconY = iconH * x;
            subView.frame = CGRectMake(iconX, iconY, iconW, iconH);
            x++;
        }
    }
}

@end
